home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2004 April
/
Gamestar_61_2004-04_dvdb.iso
/
DVDStar
/
Editace
/
hltp.exe
/
{app}
/
Source Code
/
CZBindMaker
/
Version.cs
< prev
next >
Wrap
Text File
|
2003-11-29
|
11KB
|
292 lines
/*
* CZ Bind Maker
*
* By: Steven Whitley (aka [CZ] Qw4z0)
*
* CZ Bind Maker is a key Bind utility for Counter-Strike 1.6
* and is distributed under the GNU Public License.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* If you need further support for this program you may visit
* http://www.bindmaker.org/ and post in the forums for help.
*
*
* Any Changes or modifications of this source may be submitted for inclusion
* in the official release of CZ Bind Maker to Steve Whitley at support@bindmaker.org.
*
* Be sure to comment your code as follows:
*
* // [ AUTHOR ] [ DATE ]
* // [ DESCRIPTION OF THE CHANGE OR ADDITION ]
*
* */
/* ###############################################
* # Sand Bar Library License #
* ###############################################
*
* This release of SandBar is available at no charge for you to use in your freeware products
* royalty-free. This license does not allow distribution of SandBar with software that is
* sold or generates income in any way. Use of this release is subject to my name being
* displayed as a credit in the About dialog in your application. If this is unacceptable you
* will need to purchase the commercial license.
*
* When distributing this product with software where the source code is available (under
* GPL or other similar licenses) you are required to distribute this license file with the
* binary. This is to ensure other developers understand fully the terms of this release.
*
* By using, downloading or posessing this product you agree not to attempt to decompile or
* reverse engineer it in any way. Enjoy!
*
* Tim Dawson
* http://www.divil.co.uk/net/
*
* */
using System;
using System.Net;
using System.Drawing;
using System.Threading;
using System.Collections;
using System.Diagnostics;
using System.Windows.Forms;
using System.ComponentModel;
namespace CZBindMaker
{
/// <summary>
/// Summary description for Version.
/// </summary>
public class Version : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label currentVersion;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label newestVersion;
private System.Windows.Forms.Button updateMe;
private System.Windows.Forms.Button ignore;
private string m_link;
private double m_curVersion;
private double m_newVersion;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.Button Go;
private System.Windows.Forms.Label tip;
private System.ComponentModel.IContainer components;
public Version(double curVersion, double newVersion, string link)
{
InitializeComponent();
this.m_link = link;
this.currentVersion.Text = (this.m_curVersion = curVersion).ToString();
this.newestVersion.Text = (this.m_newVersion = newVersion).ToString();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Version));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.currentVersion = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.newestVersion = new System.Windows.Forms.Label();
this.updateMe = new System.Windows.Forms.Button();
this.ignore = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.Go = new System.Windows.Forms.Button();
this.tip = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(280, 16);
this.label1.TabIndex = 0;
this.label1.Text = "Your version of CZ Bind Maker is outdated!";
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(80, 16);
this.label2.TabIndex = 1;
this.label2.Text = "Your Version:";
this.toolTip1.SetToolTip(this.label2, "Your current version of CZ Bind Maker");
//
// currentVersion
//
this.currentVersion.Location = new System.Drawing.Point(80, 40);
this.currentVersion.Name = "currentVersion";
this.currentVersion.Size = new System.Drawing.Size(200, 16);
this.currentVersion.TabIndex = 2;
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 64);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(80, 16);
this.label3.TabIndex = 3;
this.label3.Text = "Latest Version:";
this.toolTip1.SetToolTip(this.label3, "The Version of the latest version of CZ Bind Maker");
//
// newestVersion
//
this.newestVersion.Location = new System.Drawing.Point(80, 64);
this.newestVersion.Name = "newestVersion";
this.newestVersion.Size = new System.Drawing.Size(200, 16);
this.newestVersion.TabIndex = 4;
//
// updateMe
//
this.updateMe.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.updateMe.Location = new System.Drawing.Point(205, 112);
this.updateMe.Name = "updateMe";
this.updateMe.Size = new System.Drawing.Size(74, 23);
this.updateMe.TabIndex = 5;
this.updateMe.Text = "Update Me!";
this.toolTip1.SetToolTip(this.updateMe, "Update CZ Bind Maker Now!\nThis could take some time over slower connections...");
this.updateMe.Click += new System.EventHandler(this.updateMe_Click);
this.updateMe.MouseEnter += new System.EventHandler(this.updateMe_MouseEnter);
this.updateMe.MouseLeave += new System.EventHandler(this.updateMe_MouseLeave);
//
// ignore
//
this.ignore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.ignore.Location = new System.Drawing.Point(13, 112);
this.ignore.Name = "ignore";
this.ignore.Size = new System.Drawing.Size(74, 23);
this.ignore.TabIndex = 6;
this.ignore.Text = "Ignore This";
this.toolTip1.SetToolTip(this.ignore, "Click this to ignore this update (not recomended)");
this.ignore.Click += new System.EventHandler(this.ignore_Click);
this.ignore.MouseEnter += new System.EventHandler(this.ignore_MouseEnter);
this.ignore.MouseLeave += new System.EventHandler(this.updateMe_MouseLeave);
//
// Go
//
this.Go.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.Go.Location = new System.Drawing.Point(102, 112);
this.Go.Name = "Go";
this.Go.Size = new System.Drawing.Size(88, 24);
this.Go.TabIndex = 7;
this.Go.Text = "Get it Yourself";
this.toolTip1.SetToolTip(this.Go, "Download the latest version from the website\n\nYou will be prompted to update ever" +
"ytime you start the appliction until you update");
this.Go.Click += new System.EventHandler(this.Go_Click);
this.Go.MouseEnter += new System.EventHandler(this.Go_MouseEnter);
this.Go.MouseLeave += new System.EventHandler(this.updateMe_MouseLeave);
//
// tip
//
this.tip.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
this.tip.Location = new System.Drawing.Point(8, 88);
this.tip.Name = "tip";
this.tip.Size = new System.Drawing.Size(272, 16);
this.tip.TabIndex = 8;
//
// Version
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 146);
this.Controls.Add(this.tip);
this.Controls.Add(this.Go);
this.Controls.Add(this.newestVersion);
this.Controls.Add(this.ignore);
this.Controls.Add(this.updateMe);
this.Controls.Add(this.currentVersion);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Version";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "CZ Bind Maker Version Control";
this.ResumeLayout(false);
}
#endregion
private void updateMe_Click(object sender, System.EventArgs e)
{
WebClient w = new WebClient();
try
{
w.DownloadFile(this.m_link,"upgrade.exe");
System.Diagnostics.Process.Start("upgrade.exe");
}
catch(Exception ex)
{
ex.ToString();
}
}
private void ignore_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.Abort;
}
private void updateMe_MouseEnter(object sender, System.EventArgs e)
{
this.tip.Text = "This could take some time over slower connections";
}
private void updateMe_MouseLeave(object sender, System.EventArgs e)
{
this.tip.Text = "";
}
private void Go_MouseEnter(object sender, System.EventArgs e)
{
this.tip.Text = "Download the update from the website";
}
private void ignore_MouseEnter(object sender, System.EventArgs e)
{
this.tip.Text = "Ignore and continue";
}
private void Go_Click(object sender, System.EventArgs e)
{
Process.Start("https://sourceforge.net/project/showfiles.php?group_id=87863");
Application.Exit();
}
}
}